#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#define MAXN 10005
#define MAXK 105
using namespace std;
struct node
{
    int p, time;
} customer;
bool cmp(node c1, node c2)
{
    return c1.time < c2.time;
}
int main()
{
    int n, k, i, j;
    int h, m, s, p;
    cin >> n >> k;
    vector<node> cus;
    for (i = 0; i < n; ++i)
    {
        scanf("%02d:%02d:%02d %d", &h, &m, &s, &p);
        int time = h * 3600 + m * 60 + s;
        if (time > 61200)
            continue;
        customer = {p*60, time};
        cus.push_back(customer);
    }
    sort(cus.begin(), cus.end(), cmp);
    vector<int> window(k, 28800);
    double res = 0.0;
    for (i = 0; i < cus.size(); ++i)
    {
        int tempindex = 0, minfinish = window[0];
        for (j = 1; j < k; j++)
        {
            if (minfinish > window[j])
            {
                minfinish = window[j];
                tempindex = j;
            }
        }
        if (window[tempindex] <= cus[i].time)
        {
            window[tempindex] = cus[i].time + cus[i].p;
        }
        else
        {
            res += window[tempindex] - cus[i].time;
            window[tempindex] += cus[i].p;
        }
    }

    if (cus.size() == 0)
    {
        printf("0.0");
    }
    else
    {
        printf("%.1f", res / 60.0 / cus.size());
    }
    return 0;
}